﻿<sap:ActivityDesigner
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:i="clr-namespace:System.IO;assembly=mscorlib"
    xmlns:e="clr-namespace:Egelke.EHealth.Etee.Crypto.Wf"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    x:Class="Egelke.EHealth.Etee.Crypto.Wf.Design.SealDesigner" Collapsible="False">
    <sap:ActivityDesigner.Icon>
        <DrawingBrush>
            <DrawingBrush.Drawing>
                <ImageDrawing>
                    <ImageDrawing.Rect>
                        <Rect Location="0,0" Size="16,16" />
                    </ImageDrawing.Rect>
                    <ImageDrawing.ImageSource>
                        <BitmapImage UriSource="Lock-Locked.png" />
                    </ImageDrawing.ImageSource>
                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </sap:ActivityDesigner.Icon>
    <sap:ActivityDesigner.Resources>
        <ResourceDictionary>
            <sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
        </ResourceDictionary>
    </sap:ActivityDesigner.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Label Content="Sender" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" />
        <sapv:ExpressionTextBox  Grid.Row="0" Grid.Column="1" 
            Expression="{Binding Path=ModelItem.Sender, 
                                 Mode=TwoWay, 
                                 Converter={StaticResource ArgumentToExpressionConverter}, 
                                 ConverterParameter=In }"
            ExpressionType="e:Sender"
            OwnerActivity="{Binding Path=ModelItem}"
            Width="150" />

        <Label Content="Recipients" Grid.Row="0" Grid.Column="3" HorizontalAlignment="Right"  />
        <sapv:ExpressionTextBox  Grid.Row="0" Grid.Column="4" 
            Expression="{Binding Path=ModelItem.Recipients, 
                                 Mode=TwoWay, 
                                 Converter={StaticResource ArgumentToExpressionConverter}, 
                                 ConverterParameter=In }"
            ExpressionType="e:Recipients"
            OwnerActivity="{Binding Path=ModelItem}"
            Width="150" />
        
        <Label Content="->" Grid.Column="2" Grid.RowSpan="2" VerticalAlignment="Center" />

        <Label Content="In" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right" />
        <sapv:ExpressionTextBox  Grid.Row="1" Grid.Column="1" 
            Expression="{Binding Path=ModelItem.InMessage, 
                                 Mode=TwoWay, 
                                 Converter={StaticResource ArgumentToExpressionConverter}, 
                                 ConverterParameter=In }"
            ExpressionType="i:Stream"
            OwnerActivity="{Binding Path=ModelItem}"
            Width="150" />

        <Label Content="Out" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Right"  />
        <sapv:ExpressionTextBox  Grid.Row="1" Grid.Column="4" 
            Expression="{Binding Path=ModelItem.OutMessage, 
                                 Mode=TwoWay, 
                                 Converter={StaticResource ArgumentToExpressionConverter}, 
                                 ConverterParameter=In }"
            ExpressionType="i:Stream"
            OwnerActivity="{Binding Path=ModelItem}"
            Width="150" />
        
    </Grid>
</sap:ActivityDesigner>
